﻿<%@ CodePage=65001   Language=VBScript  %> 
<%

	merchantId		=Request("merchantId")
	version			=Request("version")
	language		=Request("language")
	signType		=Request("signType")
	payType			=Request("payType")	
	issuerId		=Request("issuerId")
	paymentOrderId	        =Request("paymentOrderId")
	orderNo			=Request("orderNo")
	orderDatetime	        =Request("orderDatetime")
	orderAmount		=Request("orderAmount")
	payDatetime		=Request("payDatetime")
	payAmount		=Request("payAmount")
	ext1			=Request("ext1")
	ext2			=Request("ext2")
	payResult		=Request("payResult")
	errorCode		=Request("errorCode")
	returnDatetime	        =Request("returnDatetime")
	signMsg			=Request("signMsg")

	'验签是商户为了验证接收到的报文数据确实是支付网关发送的。
	'构造订单结果对象，验证签名。
	set paymentResult = Server.CreateObject("ETSClient.com.allinpay.ets.client.PaymentResult")
	paymentResult.setMerchantId(merchantId)
	paymentResult.setVersion(version)
	paymentResult.setLanguage(language)
	paymentResult.setSignType(signType)
	paymentResult.setPayType(payType)
	paymentResult.setIssuerId(issuerId)
	paymentResult.setPaymentOrderId(paymentOrderId)
	paymentResult.setOrderNo(orderNo)
	paymentResult.setOrderDatetime(orderDatetime)
	paymentResult.setOrderAmount(orderAmount)
	paymentResult.setPayDatetime(payDatetime)
	paymentResult.setPayAmount(payAmount)
	paymentResult.setExt1(ext1)
	paymentResult.setExt2(ext2)
	paymentResult.setPayResult(payResult)
	paymentResult.setErrorCode(errorCode)
	paymentResult.setReturnDatetime(returnDatetime)
	paymentResult.setSignMsg(signMsg)  'signMsg为服务器端返回的签名值。
	paymentResult.setCertPath("d:/cert/TLCert.cer");//本示例中，证书放在当前路径的cert文件夹下
	
	
	verifyResult = paymentResult.verify()	'验证签名，返回“1”或“true”表示验签成功，否则失败。

	'验签成功，还需要判断订单状态，为"1"表示支付成功，
	If verifyResult="true" and payResult = "1"  then
		'TODO 商户订单处理，显示客户订单付款成功页面
	End If

%>

<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta http-equiv="Content-Language" content="zh-CN"/>
	<meta http-equiv="Expires" content="0" />        
	<meta http-equiv="Cache-Control" content="no-cache" />        
	<meta http-equiv="Pragma" content="no-cache" />
	<title>通联网上支付平台-商户接口范例-支付结果</title>
	</head>
<body>
	<center> <font size=16><strong>支付结果</strong></font></center>
	<div style="padding-left:40px;">
	 		<div>验签结果：<%=verifyResult%> </div>
			<div>&nbsp;</div>
			<div>商户号：<%=merchantId%> </div>
			<div>商户订单号：<%=orderNo%> </div>
			<div>商户订单金额：<%=orderAmount%></div>
			<div>商户订单时间： <%=orderDatetime%> </div>
			<div>网关支付金额： <%=payAmount%></div>
			<div>网关支付时间：<%=payDatetime%></div>
<br>
merchantId=<%=merchantId%><br>
issuerId=<%=issuerId%><br>
paymentOrderId=<%=paymentOrderId%><br>
orderNo=<%=orderNo%><br>
orderDatetime=<%=orderDatetime%><br>
orderAmount=<%=orderAmount%><br>
payDatetime=<%=payDatetime%><br>
payAmount=<%=payAmount%><br>
payResult=<%=payResult%><br>
errorCode=<%=errorCode%><br>
returnDatetime=<%=returnDatetime%><br>
signMsg=<%=signMsg%><br>
<br>


	</div>	


 </body>
</html>